﻿using Common.DataBase.Interface;
using ScanFile.Model;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;

namespace ScanFile.Dal {

  public partial class DiskExDal:BaseDal<DiskEx>{

		/// <summary>
		/// 构造函数
		/// </summary>
		public DiskExDal(){

		}

    /// <summary>
    /// 禁用记录
    /// </summary>
    /// <param name="entity"></param>
    /// <returns></returns>
    public System.Int64 DisableOnebyId(DiskEx entity) {
      _logger.Debug("DisableOnebyId");
      entity.Enabled = 0;
      return UpdateById(entity);
    }

    /// <summary>
    /// 删除所有禁用的记录
    /// </summary>
    /// <returns></returns>
    public System.Int64 DeleteAllDisable() {
      string sqlString = "DELETE FROM diskEx WHERE  enabled = @enabled;";
      List<DbParameter> paramList = new List<DbParameter>();
      paramList.Add(DbParam("@enabled", 0));
      return _sqlHelper.ExecuteNonQuery(sqlString, CommandType.Text, paramList.ToArray());
    }




  }
}
